n=672; m=1000; q=3; belt=[|628,31| 204,144| 182,31| 426,540| 525,398| 35,178| 586,322| 546,395| 14,331| 87,633| 361,246| 9,272| 272,486| 422,136| 342,270| 218,89| 557,504| 545,42| 657,286| 434,83| 208,289| 525,207| 394,422| 591,369| 211,373| 277,540| 430,226| 503,575| 467,351| 12,185| 79,100| 530,670| 354,347| 662,592| 151,431| 364,629| 189,272| 348,325| 91,122| 313,663| 89,556| 2,671| 454,210| 254,564| 652,323| 482,409| 215,178| 161,469| 342,500| 635,303| 249,301| 304,610| 543,93| 523,152| 294,438| 488,428| 169,462| 335,586| 188,353| 308,24| 654,577| 472,204| 285,630| 30,69| 99,260| 407,434| 410,256| 671,132| 78,317| 580,648| 516,310| 463,523| 647,502| 587,264| 606,71| 433,493| 264,81| 214,232| 499,449| 667,156| 620,237| 285,209| 606,280| 112,585| 144,655| 303,64| 252,315| 237,508| 498,303| 362,450| 281,488| 624,635| 272,81| 620,619| 35,478| 95,468| 129,109| 119,275| 280,619| 218,316| 497,235| 297,570| 498,5| 117,233| 427,667| 164,150| 562,308| 67,94| 214,600| 137,545| 584,379| 571,101| 624,610| 612,140| 139,540| 172,557| 157,671| 164,87| 107,509| 23,661| 87,220| 470,344| 433,657| 246,431| 422,652| 574,58| 144,129| 57,544| 376,381| 366,332| 198,441| 586,534| 650,536| 412,366| 295,229| 652,318| 392,378| 282,43| 305,132| 601,210| 582,206| 124,541| 502,171| 195,348| 424,194| 320,61| 645,3| 571,251| 218,39| 656,53| 68,90| 408,122| 571,294| 350,338| 261,130| 293,671| 138,441| 474,377| 441,656| 645,424| 9,469| 172,87| 652,345| 550,212| 598,202| 643,138| 147,70| 222,181| 200,121| 108,667| 566,588| 402,131| 55,239| 530,418| 217,175| 259,417| 510,301| 632,95| 458,161| 100,97| 312,94| 492,30| 540,88| 419,428| 351,401| 28,107| 142,147| 71,301| 623,120| 23,30| 251,422| 484,460| 409,530| 78,49| 199,572| 385,115| 324,152| 123,132| 32,85| 140,474| 424,140| 538,614| 321,520| 604,214| 220,52| 484,44| 399,450| 569,168| 588,131| 280,388| 66,443| 105,177| 437,429| 452,477| 229,34| 428,50| 495,466| 470,369| 167,366| 28,415| 149,188| 257,160| 373,13| 628,585| 61,158| 461,98| 54,146| 669,652| 406,193| 506,81| 46,632| 571,21| 230,489| 110,313| 379,312| 385,653| 457,455| 170,425| 184,155| 266,307| 312,437| 251,295| 172,643| 293,40| 270,200| 449,231| 463,223| 535,172| 51,333| 329,269| 67,65| 636,416| 553,172| 132,668| 668,414| 175,78| 82,194| 360,120| 433,295| 496,172| 322,625| 264,109| 145,470| 394,93| 81,353| 636,168| 154,413| 568,532| 546,52| 153,273| 317,117| 47,357| 533,297| 116,177| 22,660| 269,383| 143,526| 617,605| 574,209| 91,447| 7,552| 51,73| 383,200| 353,95| 374,483| 333,282| 672,373| 164,608| 662,568| 389,549| 38,233| 24,290| 280,375| 157,27| 76,32| 192,241| 82,633| 565,587| 418,411| 155,529| 436,192| 103,32| 500,141| 199,377| 9,117| 660,221| 461,140| 389,204| 588,52| 340,160| 101,466| 294,336| 451,527| 567,491| 244,438| 269,500| 670,550| 240,116| 574,533| 162,536| 377,26| 103,189| 379,165| 116,228| 521,163| 330,518| 423,4| 435,235| 329,72| 262,28| 473,506| 567,663| 607,443| 501,172| 383,355| 159,86| 669,414| 573,217| 70,173| 559,223| 666,21| 667,223| 112,108| 87,230| 553,126| 439,336| 7,277| 446,246| 130,398| 252,16| 500,100| 36,638| 562,82| 190,637| 534,86| 323,426| 278,331| 307,145| 247,312| 324,204| 232,165| 591,425| 54,259| 628,537| 580,513| 52,351| 157,258| 293,211| 498,439| 664,615| 404,640| 273,511| 236,136| 151,485| 18,572| 70,132| 41,175| 9,267| 12,451| 184,571| 270,672| 502,133| 506,151| 329,381| 502,349| 192,363| 549,514| 24,434| 663,327| 417,483| 116,482| 201,669| 489,518| 3,617| 234,375| 532,593| 439,247| 579,295| 623,665| 607,672| 576,362| 223,586| 368,151| 108,374| 109,133| 626,279| 356,502| 247,375| 225,242| 310,646| 323,47| 665,131| 307,536| 374,385| 227,583| 615,560| 500,355| 293,522| 586,327| 551,587| 320,496| 393,313| 84,658| 603,448| 500,64| 59,508| 286,187| 27,208| 374,284| 653,294| 119,227| 599,219| 275,543| 201,247| 672,89| 63,397| 481,401| 462,248| 553,460| 453,458| 623,470| 199,396| 206,398| 589,32| 349,386| 119,503| 150,29| 157,422| 396,614| 518,78| 583,479| 592,544| 267,343| 358,360| 245,291| 15,49| 43,186| 340,445| 366,582| 481,526| 330,40| 17,276| 451,666| 601,480| 254,19| 280,499| 419,577| 571,9| 298,609| 185,491| 413,100| 104,481| 133,206| 74,418| 23,651| 131,371| 245,630| 112,590| 176,151| 282,327| 640,314| 2,505| 306,498| 334,179| 432,461| 391,415| 251,246| 554,510| 18,181| 458,456| 142,45| 243,134| 389,127| 629,334| 8,514| 521,160| 358,298| 501,589| 617,221| 541,104| 108,47| 37,494| 129,430| 157,282| 279,10| 519,287| 171,106| 480,548| 127,582| 104,145| 446,502| 149,74| 568,656| 459,159| 461,380| 253,247| 383,376| 148,392| 505,243| 530,353| 154,452| 331,339| 222,647| 555,340| 436,118| 224,372| 281,632| 57,474| 216,223| 285,571| 46,573| 428,507| 591,386| 121,353| 442,113| 590,174| 511,415| 405,30| 126,50| 526,573| 176,254| 451,540| 597,272| 304,598| 45,620| 269,42| 660,189| 578,383| 296,294| 451,22| 572,325| 274,305| 172,272| 311,594| 340,368| 548,44| 466,416| 259,172| 370,579| 453,280| 633,625| 111,560| 90,295| 300,223| 406,513| 157,624| 448,669| 588,280| 452,269| 178,438| 411,625| 671,217| 487,420| 311,453| 565,487| 345,472| 202,256| 338,429| 26,143| 354,659| 200,89| 589,428| 91,528| 9,24| 157,138| 349,158| 359,464| 615,312| 329,157| 312,665| 568,407| 220,19| 634,302| 521,173| 397,474| 463,196| 491,331| 11,489| 566,538| 490,338| 415,261| 135,621| 542,207| 561,475| 272,613| 174,287| 160,183| 154,583| 427,13| 125,50| 558,629| 238,504| 489,382| 581,425| 114,76| 116,479| 473,265| 166,353| 194,624| 113,462| 569,109| 316,283| 462,416| 190,476| 355,128| 255,526| 60,381| 394,227| 482,405| 373,41| 389,229| 62,664| 660,525| 87,205| 118,370| 120,475| 82,193| 59,126| 273,444| 627,81| 225,420| 596,100| 87,298| 284,203| 653,350| 391,389| 117,526| 630,428| 470,589| 552,661| 94,178| 135,116| 111,259| 197,533| 388,395| 565,111| 104,490| 215,251| 182,361| 533,634| 177,28| 445,329| 89,446| 326,285| 37,563| 229,552| 218,505| 472,34| 270,527| 436,211| 630,165| 630,151| 440,598| 337,641| 256,522| 531,272| 259,425| 186,633| 223,197| 587,316| 104,512| 14,187| 100,265| 592,414| 348,447| 1,666| 400,197| 395,265| 571,538| 372,402| 633,236| 583,671| 471,172| 325,241| 400,285| 517,43| 166,649| 433,210| 559,664| 118,671| 84,645| 355,386| 651,144| 98,459| 623,117| 438,237| 506,545| 254,347| 464,426| 652,630| 56,67| 388,558| 317,11| 626,140| 644,348| 66,65| 549,268| 594,620| 617,380| 589,614| 630,450| 616,450| 99,554| 450,263| 639,580| 330,500| 593,25| 99,497| 218,342| 412,188| 500,630| 47,616| 603,274| 231,466| 630,52| 628,392| 598,538| 566,379| 639,82| 475,500| 356,365| 274,589| 522,350| 375,419| 551,345| 663,4| 654,254| 572,77| 48,186| 610,547| 554,332| 381,392| 75,336| 217,498| 289,436| 604,148| 140,299| 403,530| 313,587| 180,371| 471,509| 6,669| 103,563| 597,134| 167,226| 516,612| 305,471| 532,460| 15,191| 462,17| 507,156| 168,515| 474,534| 141,286| 108,520| 411,327| 455,444| 633,57| 431,448| 359,127| 329,297| 180,276| 184,99| 145,549| 270,12| 36,453| 161,405| 21,447| 535,65| 116,187| 154,527| 190,662| 385,82| 427,33| 521,636| 517,47| 341,575| 466,128| 353,123| 482,490| 226,299| 635,4| 432,466| 567,492| 523,524| 270,288| 179,108| 395,89| 421,254| 84,666| 233,224| 81,346| 57,597| 523,120| 177,230| 92,343| 57,510| 353,307| 26,356| 352,210| 480,547| 641,350| 250,310| 503,213| 646,148| 474,260| 553,407| 519,271| 570,271| 335,489| 405,322| 565,35| 287,236| 556,449| 347,433| 80,489| 661,201| 48,238| 222,392| 578,356| 569,146| 212,123| 367,57| 181,214| 638,174| 362,43| 323,184| 468,458| 387,65| 207,197| 392,145| 25,348| 437,147| 597,109| 190,580| 317,649| 75,641| 66,87| 393,202| 400,135| 594,146| 114,54| 65,80| 229,252| 142,507| 51,210| 428,222| 347,364| 304,547| 426,467| 157,576| 272,630| 295,420| 33,489| 401,12| 14,278| 450,8| 672,520| 667,657| 70,314| 621,275| 630,252| 507,654| 309,129| 344,370| 326,402| 252,63| 296,7| 304,337| 46,255| 310,335| 10,112| 599,637| 6,212| 334,465| 324,178| 96,320| 92,322| 384,2| 132,458| 642,358| 494,602| 647,480| 424,292| 209,605| 618,640| 224,646| 622,323| 20,238| 102,480| 288,390| 498,444| 302,137| 348,49| 665,175| 630,74| 155,374| 186,667| 358,276| 527,339| 480,393| 188,565| 141,248| 2,159| 455,486| 290,451| 605,611| 223,295| 328,205| 276,146| 225,503| 393,616| 52,58| 403,515| 100,205| 587,175| 331,353| 487,406| 239,500| 58,107| 524,138| 106,266| 548,507| 254,581| 540,659| 283,198| 319,356| 350,77| 599,222| 71,167| 322,458| 502,241| 574,18| 248,252| 74,10| 331,19| 31,570| 90,594| 571,371| 189,81| 8,216| 68,80| 506,671| 611,618| 514,634| 126,595| 579,539| 120,432| 117,237| 309,335| 267,566| 609,578| 37,2| 291,176| 614,130| 21,169| 244,149| 3,203| 243,126| 44,456| 250,49| 281,654| 335,338| 629,217| 499,174| 167,487| 549,370| 297,272| 188,418| 434,253| 264,53| 543,178| 504,35| 45,509| 576,278| 442,70| 598,608| 641,538| 631,652| 250,471|]; order=[|1,9| 307,5| 551,4|];